/****************************************************************************
*                                                                           *
*    File:			dmAlgoInterfaces.h                                      *
*---------------------------------------------------------------------------*
*    Description:                                                           *
*                                                                           *
*		This file is the CLR equivalent of the dmalgo.idl                   *
****************************************************************************/

#pragma once

#include "dmalgo.h"



/****************************************************************************
    Namespace DataMining -- contains the managed version of the interfaces to 
    be implemented by managed providers.
    These are:
        ICLR_DMAlgorithmFactory     <-> IDMAlgorithmFactory		-- implemented
        ICLR_DMAlgorithmMetadata    <-> IDMAlgorithmMetadata	-- implemented
        ICLR_DMAlgorithm            <-> IDMAlgorithm			-- implemented
		ICLR_DMPersist				<->	IDMPersist				-- implemented
        ICLR_DMAlgorithmNavigator   <-> IDMAlgorithmNavigator	-- implemented
        ICLR_DMDAGNavigator         <-> IDMDAGNavigation		-- implemented
        ICLR_DMCaseProcessor        <-> IDMCaseProcessor		-- implemented
        ICLR_DMCustomFunctionInfo   <-> IDMCustomFunctionInfo	-- implemented
        ICLR_DMDispatch             <-> IDMDispatch				-- implemented
		ICLR_DMTableResult			<-> IDMTableResult			-- implemented
		ICLR_SupportErrorInfo		<-> ISupportErrorInfo		-- implemented
		ICLR_DMClusteringAlgorithm	<-> IDMClusteringAlgorithm	-- implemented
		ICLR_DMSequenceAlgorithm	<-> IDMSequenceAlgorithm	-- NOT IMPLEMENTED
		ICLR_DMTimeSeriesAlgorithm	<-> IDMTimeSeriesAlgorithm	-- NOT IMPLEMENTED

    NOTE:
        Method names in the original interfaces are prefixed with "Exported"
        For example, CreateAlgorithm is declared in these interfaces as ExportedCreateAlgorithm

        This naming convention allows preserving the original name for the internal
        protected virtual method that performs the actual task.

        This way, ExportedCreateAlgorithm's implementation calls into the virtual CreateAlgorithm,
        and the managed algorithm developer will have to implement "CreateAlgorithm" instead of "InternalCreateAlgorithm"

****************************************************************************/

	//IDMAlgorithmFactory -- the managed declaration    
	[
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("E7836713-6D69-49a5-AD16-E5D55202B027"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMAlgorithmFactory
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedCreateAlgorithm(
			[System::Runtime::InteropServices::In] 
			IDMModelServices* in_pModel ,
			[System::Runtime::InteropServices::Out]
			IDMAlgorithm**    out_ppAlgorithm);


    };
    
    


    //IDMAlgorithmMetadata -- the managed declaration
	[
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("FF7AD869-61ED-4da4-8318-1836DA620DF7"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMAlgorithmMetadata
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetServiceType(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			ULONG*              out_pServiceTypeID);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetServiceName(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			DMString*           io_pstrServiceName);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetDisplayName(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			DMString*           io_pstrDescription);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetServiceGuid(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			GUID*				out_pguidServiceGUID);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetDescription(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			DMString*           io_pstrDescription);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetPredictionLimit(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			LONG*               out_pPredictionLimit);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSupDistributionFlags(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			ULONG**             out_prgFlags,
			[System::Runtime::InteropServices::Out]
			ULONG*              out_pcFlags);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSupInputContentTypes(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			ULONG**             out_prgTypes,
			[System::Runtime::InteropServices::Out]
			ULONG*              out_pcTypes);


        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSupPredictContentTypes(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			ULONG**             out_prgTypes,
			[System::Runtime::InteropServices::Out]
			ULONG*              out_pcTypes);


        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSupModelingFlags(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::Out]
			DM_MODELING_FLAG**  out_prgFlags,
			[System::Runtime::InteropServices::Out]
			ULONG*              out_pcFlags);

        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetModelingFlagName(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
            [System::Runtime::InteropServices::In] 
            DM_MODELING_FLAG	in_Flag,
			[System::Runtime::InteropServices::Out]
			DMString*           io_pstrFlagName);


	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetTrainingComplexity			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        LONG*					out_pTrainingComplexity);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetPredictionComplexity			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        LONG*					out_pPredictionComplexity	);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetExpectedQuality				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        LONG*					out_pExpectedQuality		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetScaling						(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        LONG*					out_pScaling				);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetAllowIncrementalInsert		(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfIncrementalInsert		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetAllowDuplicateKey			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfDuplicateKey			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetControl						(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        LONG*					out_pControl				);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetViewerType					(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrViewerType			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetSupportsDMDimensions			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfSupportsDMDimensions	);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetSupportsDrillthrough			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfSupportsDrillthrough,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfMustIncludeChildren	);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetSupportedFunctions			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        DM_SUPPORTED_FUNCTION **	out_prgFuncs,
						[System::Runtime::InteropServices::Out]
                        ULONG *				out_cFuncs					);

	//-------------------------------------------------------------------------
	// Service parameters access

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetNumParameters				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        ULONG*				out_pcParameters			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterName				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrParameterName		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterType				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrParameterType		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterIsRequired			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfIsRequired			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterIsExposed			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        BOOL*					out_pfIsExposed				);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterFlags				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        ULONG*				out_pulParameterFlags		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterDescription			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_LocaleID,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrDescription			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterDefaultValue		(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrDefaultValue			);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetParameterValueEnumeration	(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
						[System::Runtime::InteropServices::Out]
                        DMString *			io_pstrValueEnumeration		);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedParseParameterValue				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        ULONG					in_iParameter,
                        [System::Runtime::InteropServices::In]
                        DMString *			in_pstrParameterStrValue,
                        [System::Runtime::InteropServices::In]
                        DMVariantPtr			io_pParameterMappedValue	);

	//-------------------------------------------------------------------------
	// Algorithm Limitations and requirements

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetMarginalRequirements			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
						[System::Runtime::InteropServices::Out]
                        DMMarginalRequirements*	out_pReq);

	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetCaseIDModelled				(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,					
                        [System::Runtime::InteropServices::Out]
                        BOOL*					out_pfIsModelled);

	//-------------------------------------------------------------------------
	// Validation: Each algorithm has to validate the model using IDMAttributeSet.
	// Note that IDMAttributeSet has not been fully populated in that we have not
	// actually read the training cases yet. For instance, # of states, # of
	// attributes in a nested table won't be available at this time. However,
	// it's been populated enough to validate the structure of the model.
	//  The only valid methods to call are:
	//		GetAttributeFlags
	//		GetAttributeCount		(returns the number of attributes you can query on, not the actual attributes that will be in the dataset)
	//		IsFunctionallyDependant
	//		IsCaseAttribute
	//
	//-------------------------------------------------------------------------
	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedValidateAttributeSet			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::In]
                        IDMAttributeSet*		in_pAttributeSet);

	

	//-------------------------------------------------------------------------
	// Metadata should return TRUE only if the algorithm supports one of the following operations:
	//	- initialization from PMML
	//	- generating PMML 
	//-------------------------------------------------------------------------
	    [System::Runtime::InteropServices::PreserveSig]
        HRESULT ExportedGetSupportsPMML			(	
                        [System::Runtime::InteropServices::In]
                        IDMContextServices*	in_pContext,
                        [System::Runtime::InteropServices::Out]
                        BOOL*		out_pfSupportsPMML);
	};







    //IDMCustomFunctionInfo -- the managed declaration
	[
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("2FF40BAF-AAAD-4a67-91AC-B0D70A9EEFA0"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMCustomFunctionInfo
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetName(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            DMString *			io_pstrName);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSignature(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            DMString *			io_pstrSignature);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetReturnsTable(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            BOOL*			out_pfReturnsTable);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetDescription(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            DMString *			io_pstrDescription);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetHelpFile(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            DMString *			io_pstrHelpFile);

    
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetHelpContext(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            LONG *			io_pHelpContext);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNumParameters(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            ULONG *			out_pcParameters);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNumFlags(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::Out]
            ULONG *			out_pcFlags);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParameterType(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::In] 
			ULONG				in_iParameter,
			[System::Runtime::InteropServices::Out]
            DM_FUNC_PARAM_TYPE*	out_pType);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParameterDataType(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::In] 
			ULONG				in_iParameter,
			[System::Runtime::InteropServices::Out]
            VARTYPE*	out_pDataType);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParameterIsRequired(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::In] 
			ULONG				in_iParameter,
			[System::Runtime::InteropServices::Out]
            BOOL*	out_pfIsRequired);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetFlagName(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_SUPPORTED_FUNCTION in_Function,
			[System::Runtime::InteropServices::In] 
			ULONG			in_iFlag,
			[System::Runtime::InteropServices::Out]
            DMString *			io_pstrName);
	};






	//IDMAlgorithm -- the managed declaration
	[
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("4295259B-BBDE-4369-823B-B70ADC1F3B6F"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMAlgorithm
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedInitialize(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext ,
			[System::Runtime::InteropServices::In] 
			IDMAttributeSet*	in_pAttributeSet ,
			[System::Runtime::InteropServices::In] 
			IDMMarginalStat*	in_pMarginalStat);

			
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedInsertCases( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pExeContext,
            [System::Runtime::InteropServices::In] 
            IDMPushCaseSet *in_pCaseSet,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulNumParameters,
            [System::Runtime::InteropServices::In] 
            WCHAR*  in_rgParameterNames [  ],
            [System::Runtime::InteropServices::In] 
            DMVariantPtr  in_rgParameterValues [  ]);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedPredict( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            DM_PREDICTION_FLAGS in_Flags,
            [System::Runtime::InteropServices::In] 
            IDMAttributeGroup *in_pPredAttGroup,
            [System::Runtime::InteropServices::In] 
            DM_CaseID in_CaseID,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulCaseValues,
            [System::Runtime::InteropServices::In] 
            DM_ATTRIBUTE_VALUE *in_rgValues,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulMaxPredictions,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulMaxStates,
            [System::Runtime::InteropServices::Out] 
            DM_ATTRIBUTE_STAT **io_prgPredictions,
            [System::Runtime::InteropServices::Out] 
            ULONG *out_pulPredictions);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeIDsForCase( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            DM_NODE_FLAGS in_Flags,
            [System::Runtime::InteropServices::In] 
            DM_CaseID in_CaseID,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulCaseValues,
            [System::Runtime::InteropServices::In] 
            DM_ATTRIBUTE_VALUE *in_rgValues,
            [System::Runtime::InteropServices::In] 
            ULONG in_ulMaxNodeIDs,
            [System::Runtime::InteropServices::Out] 
            DMStringPtr **io_prgNodeIDs,
            [System::Runtime::InteropServices::Out] 
            ULONG *out_pulNodeIDs);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNavigator( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            BOOL in_fForDMDimensionContent,
            [System::Runtime::InteropServices::Out] 
            IDMAlgorithmNavigation **out_ppDAGNav);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetSampleCaseSet( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            DMString *in_pstrNodeID,
            [System::Runtime::InteropServices::Out] 
            IDMPullCaseSet **out_ppCaseSet);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetTrainingParameterActualValue( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            ULONG in_iParameter,
            [System::Runtime::InteropServices::In] 
            DMVariantPtr io_pParameterValue);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedHasFeatureSelection( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::Out] 
            BOOL *out_pHasFS);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetFeatureSelectedAttributes( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::Out] 
            ULONG *out_pCount,
            [System::Runtime::InteropServices::Out] 
            DM_Attribute **out_prgFeatureSelectedAttributes,
            [System::Runtime::InteropServices::Out] 
            DM_ATTRIBUTE_FLAGS **out_prgFSAttributeFlags);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetAttributeFeatureSelectionFlags( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            DM_Attribute in_nAttr,
            [System::Runtime::InteropServices::Out] 
            DM_ATTRIBUTE_FLAGS *out_pAttFlags);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetProcessingMemoryEstimate( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::Out] 
            LONG *out_pEstimate);
        
        [System::Runtime::InteropServices::PreserveSig]
		void ExportedUpdateMemoryEstimate( 
            [System::Runtime::InteropServices::In] 
            LONG in_lEstimateChange);
        
        [System::Runtime::InteropServices::PreserveSig]
		LONG ExportedReservedMemoryEstimate( void);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedRenderPMMLContent( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            ISAXContentHandler *in_pXMLWriter);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedPreInitializeForPMML21Parsing( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::In] 
            IDMAttributeSet *in_pAttributeSet);
        
        [System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetPMMLAlgorithmSAXHandler( 
            [System::Runtime::InteropServices::In] 
            IDMContextServices *in_pContext,
            [System::Runtime::InteropServices::Out] 
            ISAXContentHandler **out_ppSAXHandler);
        
    };


 	//IDMPersist -- the persistence interface
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("CF22ECB5-25B3-4ffa-8FE0-224B0BB03281"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMPersist
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedLoad(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In]
			IDMPersistenceReader* in_pReader);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedSave(
			[System::Runtime::InteropServices::In] 
			IDMContextServices* in_pContext,
			[System::Runtime::InteropServices::In]
			IDMPersistenceWriter* in_pWriter);

	};

	
	

	//IDMCaseProcessor -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("FA8606DA-7462-4a33-8A3D-5CFB774DEE7B"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMCaseProcessor
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedRequestCapacity(
			[System::Runtime::InteropServices::In] 
			ULONG in_cCapacity);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedProcessCase(
			[System::Runtime::InteropServices::In] 
			DM_CaseID in_CaseID,
			[System::Runtime::InteropServices::In] 
			ULONG	in_cAttributes ,
			[System::Runtime::InteropServices::In] 
			ULONG*	in_rgValues);
	};


	//IDMDAGNavigation -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("97861AA0-2E48-11d3-8C76-00600832DCED"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMDAGNavigation
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToNextTree();

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeID(
				[System::Runtime::InteropServices::Out] 
				DM_DAGNodeID*	out_pNodeID);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedLocateNode					(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedValidateNodeID				(
				[System::Runtime::InteropServices::In] 	
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParentCount				(
				[System::Runtime::InteropServices::Out] 	
				ULONG *				out_pulParents);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToParent				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ParentIndex);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParentNodeID				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ParentIndex,
				[System::Runtime::InteropServices::Out]
				DM_DAGNodeID *		out_pNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetChildCount				(
				[System::Runtime::InteropServices::Out] 
				ULONG *				out_pulChilds);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToChild					(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ChildIndex);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetChildNodeID				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ChildIndex,
				[System::Runtime::InteropServices::Out] 
				DM_DAGNodeID *		out_pNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToNextLeaf				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_ScopeNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedAddRefNodeID				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedReleaseNodeID				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);

	};

	//IDMDAGNavigation -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("F1481077-58C8-40d3-9F53-D72878D63686"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMAlgorithmNavigation
	{

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToNextTree();

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeID(
				[System::Runtime::InteropServices::Out] 
				DM_DAGNodeID*	out_pNodeID);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedLocateNode					(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedValidateNodeID				(
				[System::Runtime::InteropServices::In] 	
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParentCount				(
				[System::Runtime::InteropServices::Out] 	
				ULONG *				out_pulParents);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToParent				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ParentIndex);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetParentNodeID				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ParentIndex,
				[System::Runtime::InteropServices::Out]
				DM_DAGNodeID *		out_pNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetChildCount				(
				[System::Runtime::InteropServices::Out] 
				ULONG *				out_pulChilds);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToChild					(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ChildIndex);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetChildNodeID				(
				[System::Runtime::InteropServices::In] 
				ULONG					in_ChildIndex,
				[System::Runtime::InteropServices::Out] 
				DM_DAGNodeID *		out_pNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToNextLeaf				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_ScopeNodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedAddRefNodeID				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT	ExportedReleaseNodeID				(
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID			in_NodeID);

		// returns the property in case of simple properties.  Return S_FALSE if property not supported
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeProperty				(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*	in_pContext, 
				[System::Runtime::InteropServices::In] 
				DM_NODE_PROP			in_PropID, 
				[System::Runtime::InteropServices::In] 
				DMVariantPtr			io_pValue);

		// retrieves the array property, Return S_FALSE if property not supported
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeArrayProperty		(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*	in_pContext, 
				[System::Runtime::InteropServices::In] 
				DM_NODE_PROP			in_PropID, 
				[System::Runtime::InteropServices::Out] 
				ULONG *				out_pulArraySize,
				[System::Runtime::InteropServices::Out] 
				void **				out_prgArrayBuffer);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeUniqueName			(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*	in_pContext, 
				[System::Runtime::InteropServices::Out] 
				DMString *			io_pstrUniqueName);
		
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetNodeIDFromUniqueName		(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*	in_pContext, 
				[System::Runtime::InteropServices::In] 
				DMString *			in_pstrUniqueName,
				[System::Runtime::InteropServices::Out] 
				DM_DAGNodeID *		out_pNodeID);
		
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetUniqueNameFromNodeID		(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*	in_pContext, 
				[System::Runtime::InteropServices::In] 
				DM_DAGNodeID 			in_NodeID,
				[System::Runtime::InteropServices::Out] 
				DMString *			out_pstrUniqueName);
	};

	//ICLR_DMDispatch -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("81C85EBE-1504-4e00-93E4-7DE82828FB2C"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMDispatch
	{
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedPrepareFunction(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*			in_pContext,
				[System::Runtime::InteropServices::In] 
				DM_SUPPORTED_FUNCTION		in_Function,
				[System::Runtime::InteropServices::In] 
				ULONG						in_ulFlags,
				[System::Runtime::InteropServices::In] 
				ULONG*						in_rgFlags,
				[System::Runtime::InteropServices::In] 
				ULONG						in_ulParams,
				[System::Runtime::InteropServices::In] 
				DMVariantPtr*				in_rgParams,
				[System::Runtime::InteropServices::Out] 
				DM_COLUMN_INFO**			out_prgColumnInfo,
				[System::Runtime::InteropServices::Out] 
				ULONG*						out_pulColumnInfo);

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedInvokeFunction(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*			in_pContext,
				[System::Runtime::InteropServices::In] 
				DM_SUPPORTED_FUNCTION		in_Function,
				[System::Runtime::InteropServices::In] 
				DM_CaseID					in_CaseID,
				[System::Runtime::InteropServices::In] 
				ULONG						in_ulCaseValues,
				[System::Runtime::InteropServices::In] 
				DM_ATTRIBUTE_VALUE*			in_rgValues,
				[System::Runtime::InteropServices::In] 
				ULONG						in_ulFlags,
				[System::Runtime::InteropServices::In] 
				ULONG*						in_rgFlags,
				[System::Runtime::InteropServices::In] 
				ULONG						in_ulParams,
				[System::Runtime::InteropServices::In] 
				DMVariantPtr*				in_rgParams,
				[System::Runtime::InteropServices::Out] 
				DMVariantPtr				io_pResult);
	};


	//ICLR_DMDispatch -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("23A9D454-5B2C-4862-963F-A72231D1F58E"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMTableResult
	{
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedGetColumnCount(
				[System::Runtime::InteropServices::Out] 
				ULONG*			out_pulColumnInfo);
		
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedStart();

		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedMoveToNextRow();

		[System::Runtime::InteropServices::PreserveSig]		
		HRESULT ExportedGetColumnValue(
				[System::Runtime::InteropServices::In] 
				IDMContextServices*			in_pContext,
				[System::Runtime::InteropServices::In] 
				ULONG						in_iColumn,
				[System::Runtime::InteropServices::In] 
				DMVariantPtr				io_pColumnValue);
	};

	//ICLR_SupportErrorInfo -- the managed declaration
    [
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("DF0B3D60-548F-101B-8E65-08002B2BD119"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private interface struct ICLR_SupportErrorInfo
	{
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedInterfaceSupportsErrorInfo(
				[System::Runtime::InteropServices::In] 
				REFIID			riid);
	};


	//IDMClusteringAlgorithm -- the managed declaration
	[
        System::Runtime::InteropServices::ComImport, 
        System::Runtime::InteropServices::Guid("1B41EFC0-3E15-11d3-8C7A-00600832DCED"), 
        System::Runtime::InteropServices::InterfaceTypeAttribute(System::Runtime::InteropServices::ComInterfaceType::InterfaceIsIUnknown),
        System::Security::SuppressUnmanagedCodeSecurityAttribute
    ]
	private   interface struct  ICLR_DMClusteringAlgorithm
	{
		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedClusterMembership(
			[System::Runtime::InteropServices::In] 
			IDMContextServices*			in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_CLUSTER_MEMBERSHIP_FLAGS	in_Flags,
			[System::Runtime::InteropServices::In] 
			DMStringPtr					in_strClusterCaption,
			[System::Runtime::InteropServices::In] 
			DM_CaseID						in_CaseID,
			[System::Runtime::InteropServices::In] 
			ULONG							in_ulCaseValues,
			[System::Runtime::InteropServices::In] 
			DM_ATTRIBUTE_VALUE *			in_rgValues,
			[System::Runtime::InteropServices::In] 
			ULONG							in_ulMaxClusters,
			[System::Runtime::InteropServices::Out] 
			DM_CLUSTER_MEMBERSHIP **		io_prgClusters,
			[System::Runtime::InteropServices::Out] 
			ULONG *						out_pulClusters);


		[System::Runtime::InteropServices::PreserveSig]
		HRESULT ExportedCaseLikelihood(
			[System::Runtime::InteropServices::In] 
			IDMContextServices*			in_pContext,
			[System::Runtime::InteropServices::In] 
			DM_CASE_LIKELIHOOD_FLAGS		in_Flags,
			[System::Runtime::InteropServices::In] 
			DM_CaseID						in_CaseID,
			[System::Runtime::InteropServices::In] 
			ULONG							in_ulCaseValues,
			[System::Runtime::InteropServices::In] 
			DM_ATTRIBUTE_VALUE *			in_rgValues,
			[System::Runtime::InteropServices::Out] 
			DOUBLE *						out_pdblCaseLikelihood);
    };

